import React, { Component, Suspense } from 'react';
import { HashRouter as Router, Link, Route, NavLink, Switch } from 'react-router-dom'
import routes from './index'
//import PublicFoot from '../component/Public/public_foot.jsx'

class RouterConfig extends Component {
  render() {
    return (
      <Suspense fallback={<div>loading....</div>}>
        <Router>
          <Switch>
            {
              routes.map(route => {
                return (
                  <Route key={route.id} exact path={route.path} render={(props) => <route.component {...props} {...route.children}></route.component>}></Route>
                )
              })
            }
          </Switch>
          {/* <PublicFoot></PublicFoot> */}
        </Router>
      </Suspense>
    );
  }

}



export default RouterConfig;
